<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp" %>
<html>
    <head>
        <title>设备维护信息管理</title>
        <meta name="decorator" content="ani"/>
        <script type="text/javascript">

            $(document).ready(function () {
                $("#inputForm").validate({
                    submitHandler: function (form) {
                        jp.loading();
                        form.submit();
                    },
                    errorContainer: "#messageBox",
                    errorPlacement: function (error, element) {
                        $("#messageBox").text("输入有误，请先更正。");
                        if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
                            error.appendTo(element.parent().parent());
                        } else {
                            error.insertAfter(element);
                        }
                    }
                });

            });
        </script>
    </head>
    <body>
        <div class="wrapper wrapper-content">
            <div class="row">
                <div class="col-md-12">
                    <div class="panel panel-primary">
                        <div class="panel-heading">
                            <h3 class="panel-title">
                                <a class="panelButton" href="${ctx}/web/yjMaintenance"><i class="ti-angle-left"></i>
                                    返回</a>
                            </h3>
                        </div>
                        <div class="panel-body">
                            <form:form id="inputForm" modelAttribute="yjMaintenance" action="${ctx}/web/yjMaintenance/save"
                                       method="post" class="form-horizontal">
                                <form:hidden path="id"/>
                                <input type="hidden" name="pageIndex" value="${pageIndex}">
                                <input type="hidden" name="duration" value="${yjMaintenance.duration}">
                                <input type="hidden" name="equipment.id" value="${yjMaintenance.equipment.id}">
                                <input type="hidden" name="agents.id" value="${yjMaintenance.agents.id}">
                                <input type="hidden" name="agents.remarks" value="${yjMaintenance.agents.remarks}">

                                <sys:message content="${message}"/>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">设备号：</label>
                                    <div class="col-sm-10">
                                        <form:input path="equipment.number" readonly="true" htmlEscape="false" maxlength="30" minlength="1"
                                                    class="form-control"/>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">设备名称：</label>
                                    <div class="col-sm-10">
                                        <form:input path="equipment.name" readonly="true" htmlEscape="false" maxlength="30" minlength="1"
                                                    class="form-control"/>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">保养人员：</label>
                                    <div class="col-sm-10">
                                        <sys:gridselect url="${ctx}/web/wxUser/data" id="user" name="user.id" value="${yjMaintenance.user.id}" labelName="user.userName" labelValue="${yjMaintenance.user.userName}"
                                                        title="选择保养人员" cssClass="form-control required" fieldLabels="id|昵称" fieldKeys="id|userName" searchLabels="id|昵称" searchKeys="id|userName" ></sys:gridselect>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><font color="red">*</font>下次保养(小时)：</label>
                                    <div class="col-sm-10">
                                        <form:input path="maintenance" htmlEscape="false"
                                                    class="form-control isIntGteZero required"/>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">备注：</label>
                                    <div class="col-sm-10">
                                        <form:input path="remarks" htmlEscape="false" class="form-control"/>
                                    </div>
                                </div>
                                <c:if test="${fns:hasPermission('web:yjMaintenance:edit') || isAdd}">
                                    <div class="col-lg-3"></div>
                                    <div class="col-lg-6">
                                        <div class="form-group text-center">
                                            <div>
                                                <button class="btn btn-primary btn-block btn-lg btn-parsley"
                                                        data-loading-text="正在提交...">提 交
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                </c:if>
                            </form:form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </body>
</html>
